package com.skyable.account.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skyable.account.entity.SysRole;
import com.skyable.common.common.ServiceResult;

import java.util.List;

/**
 * @author GaoYuan
 * @title: IRoleService
 * @projectName spring-cloud-demo
 * @description: TODO
 * @date 2021/4/613:08
 */
public interface IRoleService extends IService<SysRole> {

    /**
     * 新增角色
     * @param sysRole
     * @param permissionIdList
     * @return
     */
    ServiceResult<SysRole> insertRole(SysRole sysRole, List<Long> permissionIdList);

    /**
     * 更新角色
     * @param sysRole
     * @param permissionIdList
     * @return
     */
    ServiceResult<SysRole> updateRole(SysRole sysRole, List<Long> permissionIdList);

    /**
     * 分页获取角色列表
     * @param page
     * @param limit
     * @param sysRole
     * @return
     */
    ServiceResult<IPage<SysRole>> findRoleListByPage(int page, int limit, SysRole sysRole);

    /**
     * 获取所有角色列表
     * @return
     */
    ServiceResult<List<SysRole>> findRoleList();

    /**
     * 根据ID查询角色
     * @param roleId
     * @return
     */
    ServiceResult<SysRole> findRoleById(Long roleId);

    /**
     * 删除角色
     * @param roleId
     * @return
     */
    ServiceResult<Integer> deleteRoleById(Long roleId);
}
